<?php
include_once('databaseAccess.php');

//Get Points
$questpoints = array();
for($i = 0; $i < count( $questionCategoryArray ); $i++ ) {
	$myQuestionNumber =  $questionCategoryArray[$i]['questnr'];
	$tmpPointsArray = array();
	$count = 0;
	for($y = 0; $y < count($answersArray); $y++) {
		if( $myQuestionNumber == $answersArray[$y]['questnr'] ) {
			$tmpPointsArray[$count] = $answersArray[$y]['pts'];
			$count++;
		}
	}
	$questpoints[$i]['Punkte'] = $tmpPointsArray;
}

$result = json_encode($questpoints);
echo $result;	
?>